using System.Linq;
using kinokasse.datamodel.contracts;
using Raven.Client.Indexes;
using Raven.Database.Indexing;

namespace kinokasse.belegungenrepo.Indizes
{
    public class Buchungen_NachVorstellungId : AbstractIndexCreationTask
    {
        public override IndexDefinition CreateIndexDefinition() {
            return new IndexDefinition<Buchung> {
                Map = buchungen => from buchung in buchungen select new {buchung.VorstellungsId}
            }
            .ToIndexDefinition(DocumentStore.Conventions);
        }
    }
}